import fetch from "./request.js";

// 查询
export function pageFarmProduce(data) {
  return fetch("/nb-pc/1.0.1/FarmProduceService/pageFarmProduce", {
    method: "post",
    data: data,
  });
}
// 详情
export function detailFarmProduce(data) {
  return fetch("/nb-pc/1.0.1/FarmProduceService/detailFarmProduce", {
    method: "post",
    data: data,
    headers:{
      "Content-Type":"application/json; charset=utf-8"
    },
    withLoading: true,
  });
}
// 新增
export function addFarmProduce(data) {
  return fetch("/nb-pc/1.0.1/FarmProduceService/addFarmProduce", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 修改
export function updateFarmProduce(data) {
  return fetch("/nb-pc/1.0.1/FarmProduceService/updateFarmProduce", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 上架
export function pushFarmProduce(data) {
  return fetch("/nb-pc/1.0.1/FarmProduceService/pushFarmProduce", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 下架
export function unpushFarmProduce(data) {
  return fetch("/nb-pc/1.0.1/FarmProduceService/unpushFarmProduce", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 推荐
export function recommendFarmProduce(data) {
  return fetch("/nb-pc/1.0.1/FarmProduceService/recommendFarmProduce", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 取消推荐
export function unrecommendFarmProduce(data) {
  return fetch("/nb-pc/1.0.1/FarmProduceService/unrecommendFarmProduce", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 删除
export function deleteFarmProduce(data) {
  return fetch("/nb-pc/1.0.1/FarmProduceService/deleteFarmProduce", {
    method: "post",
    data: data,
    withLoading: true,
  });
}
// 导出
export function exportFarmProduce(data) {
  return fetch("/nb-pc/1.0.1/FarmProduceService/exportFarmProduce", {
    method: "post",
    data: data,
    withLoading: true,
    responseType: "blob",
    noInterceptors:true,//配置下载不走拦截器
  });
}
